using System;
using System.Reflection;
using MvcMall.Core.Commands;
using MvcMall.Core.Contacts.Repositories;
using MvcMall.Core.Contacts.Tasks;
using MvcMall.Data.Repositories;
using MvcMall.Tasks;
using MvcMall.Tests.MvcMallData;
using NUnit.Framework;

namespace MvcMall.Tests.MvcMallTasks
{
    public class AdminUserTaskTest : ESDatabaseRepositoryTestsBase
    {
        private IAdminUserRepository _adminUserRepository;
        private IAdminPowerRepository _adminPowerRepository;
        private IAdminRoleRepository _adminRoleRepository;
        private IAdminUserTask _adminUserTask;

        public AdminUserTaskTest():base(true)
        {
            
        }

        [SetUp]
        public void Init()
        {
            _adminPowerRepository = new AdminPowerRepository();
            _adminRoleRepository = new AdminRoleRepository();
            _adminUserRepository = new AdminUserRepository();
            _adminUserTask = new AdminUserTask(_adminUserRepository, _adminPowerRepository, _adminRoleRepository);
        }

        [Test]
        public void CreateTest()
        {
            var cmd = new CreateAdminUserCommand
                                           {
                                               Email = "GeJinLove",
                                               Mobile = "123",
                                               Password = "123",
                                               UserName = "123"
                                           };
            var user = _adminUserTask.Create(cmd);

        }
    }
}